package tetris;

public class Block {
	public Block(int width, int height, String color, boolean[][] data) {
		this.width = width;
		this.height = height;
		this.color = color;
		this.data = data;
	}

	private static Block[] blocks;

	public static Block[] getBlocks() {
		if (blocks == null) {
			blocks = new Block[7];
			boolean[][] b0 = { { true, true, false, false }, { true, true, false, false },
					{ false, false, false, false }, { false, false, false, false } };
			blocks[0] = new Block(2, 2, "#FF0000", b0);
			
			boolean[][] b1 = { { true, false, false, false }, { true, false, false, false },
					{ true, false, false, false }, { true, false, false, false } };
			blocks[1] = new Block(1, 4, "#00FF00", b1);
			
			boolean[][] b2 = { { false, true, true, false }, { true, true, false, false },
					{ false, false, false, false }, { false, false, false, false } };
			blocks[2] = new Block(3, 2, "#0000FF", b2);
			
			boolean[][] b3 = { { true, true, false, false }, { false, true, true, false },
					{ false, false, false, false }, { false, false, false, false } };
			blocks[3] = new Block(3, 2, "#FFFF00", b3);
			
			boolean[][] b4 = { { true, true, true, false }, { false, false, true, false },
					{ false, false, false, false }, { false, false, false, false } };			
			blocks[4] = new Block(3, 2, "#FF00FF", b4);			
			
			boolean[][] b5 = { { true, true, true, false }, { true, false, false, false },
					{ false, false, false, false }, { false, false, false, false } };
			blocks[5] = new Block(3, 2, "#00FFFF", b5);
			
			boolean[][] b6 = { { false, true, false, false }, { true, true, true, false },
					{ false, false, false, false }, { false, false, false, false } };
			blocks[6] = new Block(3, 2, "#F4A460", b6);

		}
		return blocks;
	}

	private int width;
	private int height;
	private boolean data[][];
	private String color;

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}

	public boolean[][] getData() {
		return data;
	}

	public String getColor() {
		return color;
	}
}
